<?php

/**
 * Phalcon日志扩展
 */
namespace Website\App\Core;

class PhalBaseLogger extends \Phalcon\Logger\Adapter\File
{
    /**
     * 写入日志方法
     * @param $log  //日志等级
     * @param string $level
     */
    public function write_log($log, $level='error'){
        is_array($log) && $log = json_encode($log);

        empty($level) && $level = 'error';
        $level = strtolower($level);
        $this -> $level($log);
    }
}